﻿using System;
using System.Linq;
using System.Collections.Generic;

using Windows.Storage;
using Windows.UI.Xaml.Controls;

using XConductor.Domain.Seedwork.Playback.Settings;
using XConductor.Infrastructure.CrossCutting.Shared.Validator.DataAnnotations;

namespace XConductor.Domain.WP8.Playback.Settings
{
    internal class AudioPlayerSettings : IAudioPlayerSettings, IValidatableObject
    {
        public StorageFile InputFile;

        public MediaElement MediaElement;

        public IEnumerable<ValidationResult> Validate()
        {
            var errors = new List<ValidationResult>();

            if (this.InputFile == null) errors.Add(new ValidationResult("InputFile"));

            if (this.MediaElement == null) errors.Add(new ValidationResult("MediaElement"));

            return errors;
        }

        public bool IsValid()
        {
            return !this.Validate().Any();
        }
    }
}
